import request from "@/utils/request";
import { parseStrEmpty } from "@/utils/tetrabot";

// 查询参数列表
export function API_TaskList(query) {
  return request({
    url: "/task/page.list",
    method: "get",
    params: query,
  });
}
//任务新增
export function API_addTask(data) {
  return request({
    url: "/task/add",
    method: "post",
    data,
  });
}
// 模板删除
export function API_delTask(taskIds) {
  return request({
    url: "/task/remove/" + taskIds,
    method: "delete",
  });
}
//立即执行
export function API_ImmediateRun(taskIds) {
  return request({
    url: "/task/immediate.run/" + taskIds,
    method: "delete",
  });
}
/**根据id查询任务信息 */
export function API_GetTaskDetail(id) {
  return request({
    url: "/task/info.get/" + parseStrEmpty(id),
    method: "get",
  });
}
//模板编辑
export function API_editTask(data) {
  return request({
    url: "/task/edit",
    method: "post",
    data,
  });
}
